package edu.ynu.se.xiecheng.achitectureclass.GreenHouse.GreenhouseController;

import edu.ynu.se.xiecheng.achitectureclass.GreenHouse.GreenhouseDao.GreenhouseDAO;
import edu.ynu.se.xiecheng.achitectureclass.GreenHouse.GreenhouseEntity.Greenhouse;
import edu.ynu.se.xiecheng.achitectureclass.GreenHouse.GreenhouseService.GreenhouseService;
import edu.ynu.se.xiecheng.achitectureclass.common.controller.LogicController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "大棚信息管理")
@RestController
@RequestMapping("/greenhouse")
public class GreenhouseController extends LogicController<GreenhouseService, GreenhouseDAO, Greenhouse, Long> {

    public GreenhouseController(GreenhouseService service) {

        super(service);

    }

    // 可以添加其他自定义 API 接口
    @GetMapping("/get")

    @ApiOperation(value = "通过ID获取大棚信息", notes = "根据大棚ID获取大棚信息")

    public Greenhouse GET(@RequestParam Long id) {

        return service.GET(id);

    }
}